<template>
	<view class="page" v-if="info">
    <view class="xb-info">
      <view style="padding: 0">
        <text>监控</text>
        <view>
          <u-button size="mini" type="success" @click="showVideoWeb">查看监控</u-button>
        </view>
      </view>
    </view>
		<view class="xb-info">
			<view>
				<text>编号</text>
				<text>{{info.elevatorCode}}</text>
			</view>

			<view>
				<text>单位编号</text>
				<text>{{info.dwCode}}</text>
			</view>
			<view>
				<text>开关门</text>
				<text>{{ device_work_state[info.state].txt }}</text>
			</view>
			<view>
				<text>运行状态</text>
				<text>{{ device_work_state[info.state].txt }}</text>
			</view>
			<view>
				<text>载运情况</text>
				<text>{{ device_work_state[info.state].txt }}</text>
			</view>
			<view>
				<text>故障编码</text>
				<text>{{ device_work_state[info.state].txt }}</text>
			</view>
			<view>
				<text>年检时间</text>
				<text>{{ info.deviceCheckDate }}</text>
			</view>
		</view>
		
		<view class="xb-info">
			<view>
				<text>设备位置</text>
				<text>{{info.location}}</text>
			</view>
			<view>
				<text>设备规格</text>
				<text>{{ info.elevatorSpecifications}}</text>
			</view>
			<view>
				<text>载重（KG)</text>
				<text>{{ info.elevatorLoad }}</text>
			</view>
			<view>
				<text>速度（m/s)</text>
				<text>{{info.speed}}</text>
			</view>
			<view>
				<text>层/站/门/</text>
				<text>{{info.plies}}</text>
			</view>
			<view>
				<text>设备注册代码</text>
				<text>{{ info.deviceNumber }}</text>
			</view>
			<view>
				<text>生产厂家</text>
				<text>{{ info.factory }}</text>
			</view>
			<view>
				<text>出厂日期</text>
				<text>{{info.factoryDate}}</text>
			</view>
			<view>
				<text>控制柜编号</text>
				<text>{{ info.ctrNumber }}</text>
			</view>
			<view>
				<text>主机型号</text>
				<text>{{ info.hostNumber }}</text>
			</view>
			<view>
				<text>掖引绳规格</text>
				<text>{{ info.lineSpecifications }}</text>
			</view>
			<view>
				<text>限速器编号</text>
				<text>{{ info.speedNumber }}</text>
			</view>
	<!-- 		<view>
				<text>电梯年检时间</text>
				<text>{{ info.deviceCheckDate }}</text>
			</view> -->
			<view>
				<text>限速器检测时间</text>
				<text>{{info.speedCheckDate}}</text>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
        info:null,
        device_work_state:null
			};
		},
    onLoad(e){
      let id=e.id
      this.apis.securityApi.afElevatorInfo(id).then(res=>{
        this.info=res.data
      })
      this.apis.commonApi.getDict('device_work_state').then(res=>{
        this.device_work_state=this.dictFilter(res.data)
      })
    },
    methods:{
      showVideoWeb(){
        this.apis.securityApi.ysAccessToken().then(res=>{
          let url=this.info.pcUrl
          let accessToken=res.msg
          uni.setStorageSync("webSrc",`http://xibushigu.com:9566?url=${url}&accessToken=${accessToken}`)
          this.navTo('/pages/Xweb/Xweb?title=电梯监控')
        })

      }
    }
	}
</script>

<style lang="scss">
.xb-info{
	border-radius: 12rpx;
}
</style>
